package self.hoy.demo.cloud.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import self.hoy.demo.cloud.constant.ApplicationInterface;

/**
 * feign 使用代理模式实现【远程的http接口调用封装】
 * @author 三共小不
 * @date 2020/6/4
 */
@FeignClient(
        value = ApplicationInterface.PAYMENT_HYSTRIX_INSTANCE,
        fallback = PaymentHystrixFallBackService.class
)
public interface PaymentHystrixService {

    @GetMapping("/payment/hystrix/ok/{id}")
    String paymentOk(@PathVariable("id") Integer id);

    @GetMapping("/payment/hystrix/timeout/{id}")
    String timeout(@PathVariable("id") Integer id);
}
